class Component {
  operation() {
    return 'Base operation';
  }
}

class Decorator {
  constructor(component) {
    this.component = component;
  }

  operation() {
    return this.component.operation() + ' decorated';
  }
}

const component = new Component();
const decorator = new Decorator(component);

console.log(component.operation()); // 输出：Base operation
console.log(decorator.operation()); // 输出：Base operation decorated
